home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pcl4p341.zip / PCL4P.PAS < prev    next >
Pascal/Delphi Source File  |  1992-12-24  |  4KB  |  170 lines

  1. unit PCL4P;
  2.  
  3. interface
  4.  
  5. const
  6.    (* COMM Ports *)
  7.    COM1 = 0;
  8.    COM2 = 1;
  9.    COM3 = 2;
  10.    COM4 = 3;
  11.    (* Baud Rate Codes *)
  12.    NORESET  = -1;
  13.    Baud300  = 0;
  14.    Baud600  = 1;
  15.    Baud1200 = 2;
  16.    Baud2400 = 3;
  17.    Baud4800 = 4;
  18.    Baud9600 = 5;
  19.    Baud19200  = 6;
  20.    Baud38400  = 7;
  21.    Baud57600  = 8;
  22.    Baud115200 = 9;
  23.    (* Parity Codes *)
  24.    NoParity  = 0;
  25.    OddParity = 1;
  26.    EvenParity= 3;
  27.    (* Stop Bit Codes *)
  28.    OneStopBit  = 0;
  29.    TwoStopBits = 1;
  30.    (* Word Length Codes *)
  31.    WordLength5 = 0;
  32.    WordLength6 = 1;
  33.    WordLength7 = 2;
  34.    WordLength8 = 3;
  35.    (* Buffer Size Codes *)
  36.    Size8    = 0;
  37.    Size16   = 1;
  38.    Size32   = 2;
  39.    Size64   = 3;
  40.    Size128  = 4;
  41.    Size256  = 5;
  42.    Size512  = 6;
  43.    Size1024 = 7;
  44.    Size2048 = 8;
  45.    Size4096 = 9;
  46.    Size8192 =  10;
  47.    Size16384 = 11;
  48.    Size32768 = 12;
  49.    Size1K = 7;
  50.    Size2K = 8;
  51.    Size4K = 9;
  52.    Size8K = 10;
  53.    Size16K = 11;
  54.    Size32K = 12;
  55.    (* Line Status Masks *)
  56.    TransBufferEmpty = $20;
  57.    BreakDetect  = $10;
  58.    FramingError = $08;
  59.    ParityError  = $04;
  60.    OverrunError = $02;
  61.    DataReady    = $01;
  62.    (* Modem Status Masks *)
  63.    DCD = $80;
  64.    RI  = $40;
  65.    DSR = $20;
  66.    CTS = $10;
  67.    DeltaDCD = $08;
  68.    DeltaRI  = $04;
  69.    DeltaDSR = $02;
  70.    DeltaCTS = $01;
  71.    (* Break Signal Commands *)
  72.    ASSERT = 'A';
  73.    CANCEL = 'C';
  74.    DETECT = 'D';
  75.    (* SioDTR & SioRTS Commands *)
  76.    SetPort = 'S';
  77.    ClrPort = 'C';
  78.    ReadPort = 'R';
  79.    (* FIFO level codes *)
  80.    LEVEL_1 =  0;
  81.    LEVEL_4 =  1;
  82.    LEVEL_8 =  2;
  83.    LEVEL_14 = 3;
  84.    (* IRQ codes *)
  85.    IRQ1  = 1;
  86.    IRQ2  = 2;
  87.    IRQ3  = 3;
  88.    IRQ4  = 4;
  89.    IRQ5  = 5;
  90.    IRQ6  = 6;
  91.    IRQ7  = 7;
  92.    (* ISR codes *)
  93.    FirstISR   = 0;
  94.    SecondISR  = 1;
  95.    ThirdISR   = 2;
  96.    FourthISR  = 3;
  97.    (* SioInfo arguments *)
  98.    VERSION = 'V';
  99.    (* timeing constants *)
  100.    ONE_SECOND = 18;
  101.    SHORT_WAIT = 3;
  102.    LONG_WAIT = 10;
  103.  
  104. function SioBaud(Port, BaudCode : Integer) : Integer;
  105. function SioBrkKey : Boolean;
  106. function SioBrkSig(Port : Integer; Cmd : Char) : Integer;
  107. function SioCTS(Port : Integer) : Integer;
  108. function SioDCD(Port : Integer) : Integer;
  109. function SioDelay(Tics : Integer) : Integer;
  110. function SioDone(Port : Integer) : Integer;
  111. function SioDSR(Port : Integer) : Integer;
  112. function SioDTR(Port : Integer; Cmd : Char) : Integer;
  113. function SioError(Code : Integer) : Integer;
  114. function SioFIFO(Port, Code : Integer) : Integer;
  115. function SioFlow(Port, Tics : Integer) : Integer;
  116. function SioGetc(Port, Tics : Integer) : Integer;
  117. function SioInfo(Cmd : Char) : Integer;
  118. function SioIRQ(Port, IRQcode, ISRcode : Integer) : Integer;
  119. function SioLine(Port : Integer) : Integer;
  120. function SioLoopBack(Port : Integer) : Integer;
  121. function SioModem(Port : Integer; Mask : Char) : Integer;
  122. function SioParms(Port, ParityCode, StopBitsCode, WordLengthCode : Integer) : Integer;
  123. function SioPutc(Port : Integer; Ch : Char) : Integer;
  124. function SioRead(Port, Register : Integer) : Integer;
  125. function SioReset(Port, BaudCode : Integer) : Integer;
  126. function SioRI(Port : Integer) : Integer;
  127. function SioRTS(Port : Integer; Cmd : Char ) : Integer;
  128. function SioRxBuf(Port, BufferOfs, BufferSeg, SizeCode : Integer) : Integer;
  129. function SioRxFlush(Port : Integer) : Integer;
  130. function SioRxQue(Port : Integer) : Integer;
  131. function SioTimer : LongInt;
  132. function SioUART(Port, Address : Integer) : Integer;
  133. function SioUnGetc(Port : Integer; Ch : Byte ) : Integer;
  134.  
  135.  
  136. implementation
  137.  
  138. {$L PCL4PLIB}
  139.  
  140. function SioBaud ; external;
  141. function SioBrkKey ; external;
  142. function SioBrkSig ; external;
  143. function SioCTS ; external;
  144. function SioDCD ; external;
  145. function SioDelay ; external;
  146. function SioDone ; external;
  147. function SioDSR ; external ;
  148. function SioDTR ; external;
  149. function SioError ; external;
  150. function SioFIFO ; external;
  151. function SioFlow ; external;
  152. function SioGetc ; external;
  153. function SioInfo ; external;
  154. function SioIRQ ; external;
  155. function SioLine ; external;
  156. function SioLoopBack ; external;
  157. function SioModem ; external;
  158. function SioParms ; external;
  159. function SioPutc ; external;
  160. function SioRead ; external;
  161. function SioReset ; external;
  162. function SioRI ; external;
  163. function SioRTS ; external;
  164. function SioRxBuf ; external;
  165. function SioRxFlush ; external;
  166. function SioRxQue ; external;
  167. function SioTimer ; external;
  168. function SioUART ; external;
  169. function SioUnGetc ; external;
  170. end.